// TODO: 继承与重载
// DATE: 2022/3/25
// AUTHOR: Cheng Ze WUST
open class Person(private val name:String){
    //open相当于移除final修饰
    private fun showName()="名字叫$name"
    open fun myName()= println(showName())
    fun personSay()= println("父类方法")
}

class Student(private val stuName:String):Person(stuName){
    override fun myName()= println("学生名字叫$stuName")
    fun studentSay()= println("子类方法")
}

fun main(args: Array<String>){
    var Zhang:Person=Person("ZhangSan")
    Zhang.myName()
    var Wang:Student=Student("WangWu")
    Wang.myName()
    println(Wang is Student)
    println(Wang is Person)
    println(Zhang is Student)
    Wang.personSay()
    Zhang.personSay()
}